<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;


// ++++++++++++++++++++ 后台 ++++++++++++++++++++ //
Route::rule('MiniProgram','admin/MiniProgram/index');
Route::rule('MiniProgram/AuthCode','admin/MiniProgram/AuthCode');
Route::rule('wx/index/:appId','admin/Wx/index');
Route::rule('wx/ticket','admin/wx/ticket');
Route::rule('wx/authcodecallback','admin/Wx/AuthcodeCallback');



// ++++++++++++++++++++ API 接口 ++++++++++++++++++++ //
// 用户授权相关
Route::post('api/token/user','api/Token/getToken');
Route::post('api/token/verify','api/Token/verifyToken');
// 首页
Route::rule('wx/getHomeFrame','api/HomeFrame/getHomeFrame');
// 弹屏优惠券列表
Route::rule('wx/getHomeAdvertisment','api/HomeFrame/getHomeAdvertisment');
// 个人信息
Route::rule('wx/getUserInfo','api/UserInfo/getUserInfo');
Route::rule('wx/saveUserInfo','api/UserInfo/saveUserInfo');
Route::rule('wx/decodePhone','api/UserInfo/decodePhone');
// 帐户充值、微信充值、用户开通会员卡、明细列表 等接口
Route::group('user',[
    'createrecharge' => ['api/UserInfo/UserRecharge',['method'=>'post']],
    'Paymentrecharge' => ['api/UserInfo/Paymentrecharge',['method'=>'post']],
    'Rechargenotify' => ['api/UserInfo/rechargeNotify',['method'=>'post']],
    'openMembercard' => ['api/UserInfo/openMemberCard',['method'=>'post']],
    'purchasehistory' => ['api/UserInfo/ConsumptionOrrechargeRecord',['method'=>'post']]
]);

// 产品相关
Route::group('wx/product',[
    'getProductPageSite' => ['api/Product/getProductPageSite',['method'=>'post']], // 产品页设置
    'getProductClass' => ['api/Product/getProductClass',['method'=>'post']], // 产品分类列表
    'getProductList' => ['api/Product/getProductList',['method'=>'post']],
    'getProductDetails' => ['api/Product/getProductDetails',['method'=>'post']],
    'getProductPrice' => ['api/Product/getProductPrice',['method'=>'post']]
]);

Route::rule('wx/account/getAccountRecord','api/Account/getAccountRecord');
// 积分相关
Route::rule('wx/integral/getIntegralRecord','api/Integral/getIntegralRecord');
Route::rule('wx/integral/getIntegralProduct','api/Integral/getIntegralProduct');
Route::rule('wx/integral/getIntegralRule','api/Integral/getIntegralRule');

// 优惠券相关
Route::rule('wx/coupon/getTenantCoupon','api/Coupon/getTenantCoupon');
Route::rule('wx/coupon/getMyCoupon','api/Coupon/getMyCoupon');
Route::rule('wx/coupon/receiveCoupon','api/Coupon/receiveCoupon');
Route::rule('wx/coupon/getCanUseCoupons','api/Coupon/getCanUseCoupons');

// 购物车列表
Route::rule('wx/getMyShopingCars','api/ShoppingCar/getMyShopingCars');
// 查看订单
Route::rule('wx/order/getOrder','api/Order/getOrder');
Route::rule('wx/order/getOrderDetails','api/Order/getOrderDetails');
// 商家的会员
Route::rule('wx/member/getTenantMemberType','api/Member/getTenantMemberType');
// 我的会员
Route::rule('wx/member/getUserMemberType','api/Member/getUserMemberType');
// 文章列表
Route::rule('wx/article/getArticle','api/Article/getArticle');
Route::rule('wx/article/getArticleDetail','api/Article/getArticleDetail');
// 配送费
Route::rule('wx/tenant/getTenantDistribution','api/Tenant/getTenantDistribution');
// 分销规则
Route::rule('wx/sale/getSaleRule','api/Sale/getSaleRule');
// 创建当面付订单
Route::rule('wx/face/createOrder','api/OfflineOrder/createOrder');

// 店铺相关
Route::group('wx/store',[
    'getStoreList' => ['api/TenantStore/getStoreList',['method'=>'post']],
    'getStoreSortForDistance' => ['api/TenantStore/getStoreSortForDistance',['method'=>'post']],
    'getNearbyStore' => ['api/TenantStore/getNearbyStore',['method'=>'post']],
    'getStoreSort' => ['api/TenantStore/getStoreSort',['method'=>'post']],
    'searchStore' => ['api/TenantStore/searchStore',['method'=>'post']],
    'getStoreDetails' => ['api/TenantStore/getStoreDetails',['method'=>'post']]
]);

// 售后图片上传
Route::post('api/uploadfile','api/UploadFile/upload');

// 订单相关
Route::post('createorder','api/Order/placeOrder');
Route::group('api/pay',[
    'pre_order' => ['api/Pay/getPreOrder',['method'=>'post']],
    'notify' => ['api/Pay/receiveNotify',['method'=>'post']],
    'notifyOff' => ['api/Pay/receiveNotifyOffline',['method'=>'post']],
    'balance' => ['api/Pay/balancePay',['method'=>'post']],
    'offlineBalance' => ['api/Pay/offlineBalancePay',['method'=>'post']],
    'offlineWechat' => ['api/Pay/offlineWecharPay',['method'=>'post']]
]);
// 生成积分订单
Route::post('api/Integralexchange','api/IntegralOrder/placeintegralOrder');
Route::group('api/order',[
    'getOrderFormalCancel' => ['api/Order/getOrderFormalCancel',['method'=>'post']],
    'orderQuery' => ['api/order/orderQuery',['method'=>'post']],
    'ConfirmGoods' => ['api/Order/ConfirmCollectGoods',['method'=>'post']],
    'getLogistics' => ['api/Order/getLogistics',['method'=>'post']],
    'refund' => ['api/Order/refund',['method'=>'post']],
    'WriteOff' => ['api/Order/WriteOffOrder',['method'=>'post']],
    'cancelrefund' => ['api/Order/cancelrefund',['method'=>'post']],
    'getOrderId' => ['api/Order/getOrderId',['method'=>'post']],
    'queryDeliverFee' => ['api/Order/queryDeliverFee',['method'=>'post']]
]);

// 分销
// 绑定上级关系
Route::post('api/user/BindUser','api/UserInfo/BindingSuperior');
// 用户预计收益
Route::post('api/user/Userexea','api/Sale/GetExpectedEarnings');
Route::post('api/user/RealIncome','api/Sale/GETRealIncome');
Route::post('api/user/Presentrecord','api/Sale/getPutforwardList');

// 拼团
Route::group('api',[
    'getGroupList' => ['api/Group/GroupList',['method'=>'post']],
    'getGroupDetails' => ['api/Group/GroupDetails',['method'=>'post']],
    'MakeGroup' => ['api/Group/MakeGroup',['method'=>'post']],
    'myGroups' => ['api/Group/myGroups',['method'=>'post']],
    'myGroupDetails' => ['api/Group/myGroupDetails',['method'=>'post']],
    'groupFail' => ['api/Group/groupFail',['method'=>'get']]
]);

Route::post('api/gettemplatelist','api/TemplateMessage/gettemplatelist');

// 达达配送物流跟踪
Route::group('api/dada',[
    'LT' => ['api/DadaApi/LogisticsTracking',['method'=>'post']]
]);
